package com.asm.shiroweb.common.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class EncryptionPassword {

    final public static String ALGORITHM = "MD5";
    final public static String SALT = "salt";
    final public static int ITERATIONS = 3;

    // md5 加密工具   EncryptionPassword.MD5()
    public static String MD5(String psd){

        final SimpleHash obj = new SimpleHash(ALGORITHM, ByteSource.Util.bytes(psd), SALT, ITERATIONS);

        return obj.toString();
    }
    
}
